const express = require('express')
const app = express()
const history = require('connect-history-api-fallback');
//三.
require('./db')
//4.
const cookieParser = require('cookie-parser')
//8.
const JWT = require('./tools/jwt')
const {verify}=JWT

app.use(express.static(__dirname + '/static'))
app.use(express.urlencoded({extended:false}))
app.use(express.json())
app.use(cookieParser())
app.use(history());

app.use('/',require('./router/loginBefore'))
//9.
app.use('/login',verify,require('./router/loginAfter'))

app.listen(3000, () => {
    console.log('服务器运行中...');
})